#include		<stdlib.h>
#include		<stdio.h>
#include		"ftrace.h"
#include		"list.h"

void			dsp_sym(s_sym *sym, void *dummy)
{
  (void) dummy;
  printf(" %lx %s\n", sym->addr, sym->name);
}

void			destruct_symlist_internal(void *elem, void *dummy)
{
  s_sym *sym;

  (void) dummy;
  if (elem)
  {
    sym = (s_sym *) elem;
    free(sym->name);
    free(elem);
  }
}

void			destruct_symlist(s_list *symlist)
{
  if (symlist)
  {
    list_foreach(symlist, NULL, &destruct_symlist_internal);
    destruct_list(symlist);
  }
}

void			heap_dsc(void *elem, void *arg)
{
  (void) arg;
  free(elem);
}
